<?php
declare (strict_types = 1);

namespace app\controller;

use app\BaseController;
use thans\jwt\facade\JWTAuth;

class Login extends BaseController
{
    //登录逻辑
    public  function  index(){
        $data=[
            'id'=>1,
            'name'=>'kevin'
        ];
        //加密数据生成token
        $token = JWTAuth::builder($data);
        //
        $data['token']=$token;
        api_exit($data);
    }

}
